#include <54func.h>
int main(int argc,char *argv[])
{
    // ./1_homework_B dir
    ARGS_CHECK(argc,2);
    DIR *dirp = opendir(argv[1]);//打开一个目录
    ERROR_CHECK(dirp,NULL,"opendir");
    //读取该目录流
    struct dirent *pdirent;
    //readdirL：读取到末尾会返回NULL
    while((pdirent = readdir(dirp)) != NULL)
    {
        printf("%s\n",pdirent->d_name);
    }
    closedir(dirp);
    return 0;
}
